import {createRouter, createWebHashHistory} from 'vue-router'
import HomeView from "@/views/home/HomeView.vue";

const router = createRouter({
    history: createWebHashHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/:pathMatch(.*)*',
            name: 'NotFound',
            component: () => import('@/views/NotFoundView.vue')
        },
        {
            path: '/',
            name: 'home',
            component: HomeView
        },
        {
            path: '/ai',
            name: 'ai',
            component: () => import('@/views/ai/AIView.vue')
        },
        {
            path: '/pdf',
            name: 'pdf',
            component: () => import('@/views/pdf/PdfView.vue'),
            children: [
                {
                    path: '',
                    name: 'pdf-index',
                    redirect: '/pdf/convert',
                },
                {
                    path: 'convert',
                    name: 'pdf-convert',
                    component: () => import('@/views/pdf/PdfConvertView.vue')
                },
                {
                    path: 'cut',
                    name: 'pdf-cut',
                    component: () => import('@/views/pdf/PdfCutView.vue')
                },
                {
                    path: 'merge',
                    name: 'pdf-merge',
                    component: () => import('@/views/pdf/PdfMergeView.vue')
                },
                {
                    path: 'compress',
                    name: 'pdf-compress',
                    component: () => import('@/views/pdf/PdfCompressView.vue')
                },
                {
                    path: 'unlock',
                    name: 'pdf-unlock',
                    component: () => import('@/views/pdf/PdfUnlockView.vue')
                },
                {
                    path: 'extract',
                    name: 'pdf-extract',
                    component: () => import('@/views/pdf/PdfExtractView.vue')
                },
                {
                    path: 'rotate',
                    name: 'pdf-rotate',
                    component: () => import('@/views/pdf/PdfRotateView.vue')
                },
            ]
        },
        {
            path: '/doc',
            name: 'doc',
            component: () => import('@/views/doc/DocView.vue')
        },
        {
            path: '/ebook',
            name: 'ebook',
            component: () => import('@/views/ebook/EBookView.vue')
        },
        {
            path: '/img',
            name: 'img',
            component: () => import('@/views/img/ImgDealView.vue')
        },
        {
            path: '/audio',
            name: 'audio',
            component: () => import('@/views/audio/AudioView.vue')
        },
        {
            path: '/video',
            name: 'video',
            component: () => import('@/views/video/VideoView.vue')
        },
        {
            path: '/pwd',
            name: 'pwd',
            component: () => import('@/views/pwd/PwdView.vue')
        },
        {
            path: '/zip',
            name: 'zip',
            component: () => import('@/views/zip/ZipView.vue')
        },
        {
            path: '/program',
            name: 'program',
            component: () => import('@/views/program/ProgramView.vue')
        },
        {
            path: '/ocr',
            name: 'ocr',
            component: () => import('@/views/ocr/OcrView.vue')
        },
        {
            path: '/lottery',
            name: 'lottery',
            component: () => import('@/views/lottery/LotteryView.vue')
        },
    ]
})

export default router
